<#assign path = request.getContextPath() />
<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>重置密码</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="${path}/static/css/font.css">
        <link rel="stylesheet" href="${path}/static/css/css.css">
		<link rel="stylesheet" type="text/css" href="${path}/static/css/xadmin.css"/>
        <script type="text/javascript" src="${path}/static/lib/layui/layui.js"></script>
        <script type="text/javascript" src="${path}/static/js/xadmin.js"></script>
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <form class="layui-form">
                  <div class="layui-form-item">
                      <label for="username" class="layui-form-label">原密码</label>
                      <div class="layui-input-inline">
                          <input type="number" name="username" placeholder="原密码" class="layui-input">
                      </div>
                  </div>
				   <div class="layui-form-item">
				      <label for="username" class="layui-form-label">新密码</label>
				      <div class="layui-input-inline">
							<input type="number" name="username" placeholder="新密码" class="layui-input">
				      </div>
				  </div>
				  <div class="layui-form-item">
				      <label for="username" class="layui-form-label">新密码</label>
				      <div class="layui-input-inline">
				  			<input type="number" name="username" placeholder="再一次输入新密码" class="layui-input">
				      </div>
				  </div>
                  <div class="layui-form-item">
                      <label for="L_repass" class="layui-form-label"></label>
                      <button  class="btn" lay-filter="keep" lay-submit="">保存</button>
                      <button  class=" btn-nobg" lay-filter="reset" lay-submit="reset">重置</button>
                  </div>
              </form>
            </div>
        </div>
        <script>
			
				
			layui.use(['form', 'layer'],
			function() {
			    $ = layui.jquery;
			    var form = layui.form,
			    layer = layui.layer;
			
			    //自定义验证规则
			    form.verify({
			        nikename: function(value) {
			            if (value.length < 5) {
			                return '昵称至少得5个字符啊';
			            }
			        },
			        pass: [/(.+){6,12}$/, '密码必须6到12位'],
			        repass: function(value) {
			            if ($('#L_pass').val() != $('#L_repass').val()) {
			                return '两次密码不一致';
			            }
			        }
			    });
			
			
			form.on('submit(reset)',
				function(data) {
				    console.log(data);
				    //发异步，把数据提交给php
				    layer.alert("重置成功", {
				        icon: 6
				    },
				    function() {
				        //关闭当前frame
				        xadmin.close();
				
				        // 可以对父窗口进行刷新 
				        xadmin.father_reload();
				    });
				    return false;
				});
            });
			</script>
        
    </body>

</html>
